import 'babel-polyfill';
import Vue from 'vue'
import Vuex from 'vuex';
import VueRouter from "vue-router";

import routes from "./router";
import App from './App.vue';
import stores from "./store";
import {
	getCookie
} from "./utils";
import "./common.js";

import "./components/elUI";

import './css/element-variables.scss';
import "./css/common.css";
import "./css/Odometer.css";
import "./css/iconfont/iconfont.css";
import BaiduMap from 'vue-baidu-map'

// import { Button, Select } from 'element-ui';
import Odometer from './lib/odometer';




Vue.config.productionTip = false

Vue.use(VueRouter);//路由vue-router
Vue.use(Vuex);//状态管理vuex
Vue.use(BaiduMap, {
	// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
	ak: 'Do02NhEwelmc2pD9CEGqySxtGrKGKNCU'
  })
const store = new Vuex.Store(stores);

const router = new VueRouter({
	mode: "history",
	routes,
})
router.beforeEach((to, from, next) => {
	// let { name } = to;
	// let unFilter = ["login","dp1","dp2","dp3","demodp3","welcome"];//不需要过滤的路由
	// let pStr = localStorage.pMenu || "[]";
	// let pMenu = JSON.parse(pStr);
	// let flag1 = unFilter.some((item) => item == name);
	// let flag2 = pMenu.some((item) => item == name);
	// if (flag1) {
	// 	next();
	// } else if (flag2) {
	// 	next();
	// } else {
	// 	location.href = "/login";
	// }
	next();

})
new Vue({
	el: '#app',
	router,
	store,
	render: h => h(App)
})
